package com.pmcc.core.dto;

/**
 * Created by syk on 17/7/26.
 */

import java.util.HashMap;
import java.util.Map;



public class ApiResult {

    private HashMap map;

    public ApiResult() {

        map = new HashMap();
    }

    public ApiResult Add(String key, Object value) {
        map.put(key, value);
        return this;
    }

    public HashMap Success()
    {
        map.put("success",true);
        return map;
    }

    public HashMap Error(String msg) {
        map.put("error", msg);
        return map;
    }

    public HashMap Error(int code, String msg) {
        map.put("error", msg);
        map.put("errorcode", code);
        return map;
    }
}

